{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "from opendatatools import swindex,stock\n",
    "import pandas as pd\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "df, msg = swindex.get_index_list()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   index_code   index_name section_name  start_date\n",
      "0      803611       申万价值优势         量化策略  2004/12/31\n",
      "1      803612       申万价值发现         量化策略  2004/12/31\n",
      "2      803613       申万价值稳健         量化策略  2004/12/31\n",
      "3      801001         申万50         市场表征  1999/12/30\n",
      "4      801002        申万中小板         市场表征  1999/12/30\n",
      "5      801003         申万Ａ指         市场表征  1999/12/30\n",
      "6      801005        申万创业板         市场表征   2009/11/5\n",
      "7      801300      申万300指数         市场表征  1999/12/30\n",
      "8      801901         基金重仓         市场表征  1999/12/30\n",
      "9      801903         基金核心         市场表征  1999/12/30\n",
      "10     801905         申万重点         市场表征  1999/12/30\n",
      "11     801250         申万制造         市场表征  1999/12/30\n",
      "12     801260         申万消费         市场表征  1999/12/30\n",
      "13     801270         申万投资         市场表征  1999/12/30\n",
      "14     801280         申万服务         市场表征  1999/12/30\n",
      "15     802611         申万传媒         市场表征  2004/12/30\n",
      "16     802613         养老指数         市场表征  2016/10/31\n",
      "17     802612         申万电子         市场表征  2004/12/30\n",
      "18     801010         农林牧渔         一级行业  1999/12/30\n",
      "19     801020           采掘         一级行业  1999/12/30\n",
      "20     801030           化工         一级行业  1999/12/30\n",
      "21     801040           钢铁         一级行业  1999/12/30\n",
      "22     801050         有色金属         一级行业  1999/12/30\n",
      "23     801080        电子元器件         一级行业  1999/12/30\n",
      "24     801110         家用电器         一级行业  1999/12/30\n",
      "25     801120         食品饮料         一级行业  1999/12/30\n",
      "26     801130         纺织服装         一级行业  1999/12/30\n",
      "27     801140         轻工制造         一级行业  1999/12/30\n",
      "28     801150         医药生物         一级行业  1999/12/30\n",
      "29     801160         公用事业         一级行业  1999/12/30\n",
      "..        ...          ...          ...         ...\n",
      "56     801842        中价股指数         风格指数  1999/12/30\n",
      "57     801843        低价股指数         风格指数  1999/12/30\n",
      "58     801851        亏损股指数         风格指数  1999/12/30\n",
      "59     801852        微利股指数         风格指数  1999/12/30\n",
      "60     801853        绩优股指数         风格指数  1999/12/30\n",
      "61     801861         配股指数         风格指数  1999/12/30\n",
      "62     801862         活跃指数         风格指数  1999/12/30\n",
      "63     801863         新股指数         风格指数  1999/12/30\n",
      "64     802600         装备制造         定制发布  2004/12/31\n",
      "65     806001       申万三板做市          新三板   2014/8/29\n",
      "66     806010   申万宏源新三板计算机          新三板  2014/12/31\n",
      "67     806020    申万宏源新三板机械          新三板  2014/12/31\n",
      "68     806030    申万宏源新三板化工          新三板  2014/12/31\n",
      "69     806040    申万宏源新三板传媒          新三板  2013/12/31\n",
      "70     806050  申万宏源新三板电气设备          新三板  2004/12/31\n",
      "71     806060    申万宏源新三板电子          新三板  2004/12/31\n",
      "72     806070  申万宏源新三板建筑装饰          新三板  2004/12/31\n",
      "73     806080  申万宏源新三板医药生物          新三板  2004/12/31\n",
      "74     806090    申万宏源新三板通信          新三板   2015/6/30\n",
      "75     806100  申万宏源新三板农林牧渔          新三板   2015/6/30\n",
      "76     806110  申万宏源新三板公用事业          新三板   2015/6/30\n",
      "77     806120  申万宏源新三板休闲服务          新三板   2015/6/30\n",
      "78     806130  申万宏源新三板有色金属          新三板   2015/6/30\n",
      "79     806140    申万宏源新三板汽车          新三板   2015/6/30\n",
      "80     806150  申万宏源新三板轻工制造          新三板   2015/6/30\n",
      "81     806160  申万宏源新三板建筑材料          新三板   2015/6/30\n",
      "82     806170  申万宏源新三板非银金融          新三板   2015/6/30\n",
      "83     806180  申万宏源新三板食品饮料          新三板   2015/6/30\n",
      "84     806190  申万宏源新三板商业贸易          新三板   2015/6/30\n",
      "85     806200  申万宏源新三板交通运输          新三板   2015/6/30\n",
      "\n",
      "[86 rows x 4 columns]\n"
     ]
    }
   ],
   "source": [
    "print(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: []\n",
       "Index: []"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stocks, msg = swindex.get_index_cons('801931')\n",
    "#stocks.sort_values(by=['weight'],ascending=False)\n",
    "stocks"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>start_date</th>\n",
       "      <th>stock_code</th>\n",
       "      <th>stock_name</th>\n",
       "      <th>weight</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600519</td>\n",
       "      <td>贵州茅台</td>\n",
       "      <td>11.1479</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>000651</td>\n",
       "      <td>格力电器</td>\n",
       "      <td>6.5227</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>000333</td>\n",
       "      <td>美的集团</td>\n",
       "      <td>5.9786</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002415</td>\n",
       "      <td>海康威视</td>\n",
       "      <td>2.4577</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600585</td>\n",
       "      <td>海螺水泥</td>\n",
       "      <td>1.9406</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>603288</td>\n",
       "      <td>海天味业</td>\n",
       "      <td>1.7257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600309</td>\n",
       "      <td>万华化学</td>\n",
       "      <td>1.5857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600340</td>\n",
       "      <td>华夏幸福</td>\n",
       "      <td>0.9094</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>601155</td>\n",
       "      <td>新城控股</td>\n",
       "      <td>0.7801</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600436</td>\n",
       "      <td>片仔癀</td>\n",
       "      <td>0.7394</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>000895</td>\n",
       "      <td>双汇发展</td>\n",
       "      <td>0.6180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>000963</td>\n",
       "      <td>华东医药</td>\n",
       "      <td>0.5959</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>603589</td>\n",
       "      <td>口子窖</td>\n",
       "      <td>0.5864</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002127</td>\n",
       "      <td>南极电商</td>\n",
       "      <td>0.5558</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600516</td>\n",
       "      <td>方大炭素</td>\n",
       "      <td>0.5170</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300136</td>\n",
       "      <td>信维通信</td>\n",
       "      <td>0.5006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300760</td>\n",
       "      <td>迈瑞医疗</td>\n",
       "      <td>0.4989</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300122</td>\n",
       "      <td>智飞生物</td>\n",
       "      <td>0.4980</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002460</td>\n",
       "      <td>赣锋锂业</td>\n",
       "      <td>0.4718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600426</td>\n",
       "      <td>华鲁恒升</td>\n",
       "      <td>0.4317</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>601138</td>\n",
       "      <td>工业富联</td>\n",
       "      <td>0.4312</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600763</td>\n",
       "      <td>通策医疗</td>\n",
       "      <td>0.4084</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600809</td>\n",
       "      <td>山西汾酒</td>\n",
       "      <td>0.4032</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600779</td>\n",
       "      <td>水井坊</td>\n",
       "      <td>0.3873</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002507</td>\n",
       "      <td>涪陵榨菜</td>\n",
       "      <td>0.3650</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300601</td>\n",
       "      <td>康泰生物</td>\n",
       "      <td>0.3498</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>000830</td>\n",
       "      <td>鲁西化工</td>\n",
       "      <td>0.3495</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600398</td>\n",
       "      <td>海澜之家</td>\n",
       "      <td>0.3465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002508</td>\n",
       "      <td>老板电器</td>\n",
       "      <td>0.3314</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600801</td>\n",
       "      <td>华新水泥</td>\n",
       "      <td>0.2899</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>68</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600452</td>\n",
       "      <td>涪陵电力</td>\n",
       "      <td>0.0693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002755</td>\n",
       "      <td>奥赛康</td>\n",
       "      <td>0.0646</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300761</td>\n",
       "      <td>立华股份</td>\n",
       "      <td>0.0633</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300577</td>\n",
       "      <td>开润股份</td>\n",
       "      <td>0.0597</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>000048</td>\n",
       "      <td>*ST康达</td>\n",
       "      <td>0.0579</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600408</td>\n",
       "      <td>ST安泰</td>\n",
       "      <td>0.0532</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002016</td>\n",
       "      <td>世荣兆业</td>\n",
       "      <td>0.0528</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600802</td>\n",
       "      <td>福建水泥</td>\n",
       "      <td>0.0526</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600618</td>\n",
       "      <td>氯碱化工</td>\n",
       "      <td>0.0512</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300751</td>\n",
       "      <td>迈为股份</td>\n",
       "      <td>0.0507</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>000885</td>\n",
       "      <td>城发环境</td>\n",
       "      <td>0.0506</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002803</td>\n",
       "      <td>吉宏股份</td>\n",
       "      <td>0.0486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>603068</td>\n",
       "      <td>博通集成</td>\n",
       "      <td>0.0485</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>94</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>603583</td>\n",
       "      <td>捷昌驱动</td>\n",
       "      <td>0.0482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300771</td>\n",
       "      <td>智莱科技</td>\n",
       "      <td>0.0465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>603868</td>\n",
       "      <td>飞科电器</td>\n",
       "      <td>0.0440</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>000912</td>\n",
       "      <td>泸天化</td>\n",
       "      <td>0.0408</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300121</td>\n",
       "      <td>阳谷华泰</td>\n",
       "      <td>0.0386</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002901</td>\n",
       "      <td>大博医疗</td>\n",
       "      <td>0.0367</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>603666</td>\n",
       "      <td>亿嘉和</td>\n",
       "      <td>0.0367</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>600250</td>\n",
       "      <td>南纺股份</td>\n",
       "      <td>0.0351</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>603185</td>\n",
       "      <td>上机数控</td>\n",
       "      <td>0.0342</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002947</td>\n",
       "      <td>恒铭达</td>\n",
       "      <td>0.0320</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>000502</td>\n",
       "      <td>绿景控股</td>\n",
       "      <td>0.0318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>603700</td>\n",
       "      <td>宁波水表</td>\n",
       "      <td>0.0259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300763</td>\n",
       "      <td>锦浪科技</td>\n",
       "      <td>0.0253</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300752</td>\n",
       "      <td>隆利科技</td>\n",
       "      <td>0.0250</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>300757</td>\n",
       "      <td>罗博特科</td>\n",
       "      <td>0.0245</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002952</td>\n",
       "      <td>亚世光电</td>\n",
       "      <td>0.0225</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>2019-05-13</td>\n",
       "      <td>002942</td>\n",
       "      <td>新农股份</td>\n",
       "      <td>0.0223</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   start_date stock_code stock_name   weight\n",
       "71 2019-05-13     600519       贵州茅台  11.1479\n",
       "4  2019-05-13     000651       格力电器   6.5227\n",
       "2  2019-05-13     000333       美的集团   5.9786\n",
       "23 2019-05-13     002415       海康威视   2.4577\n",
       "75 2019-05-13     600585       海螺水泥   1.9406\n",
       "90 2019-05-13     603288       海天味业   1.7257\n",
       "61 2019-05-13     600309       万华化学   1.5857\n",
       "63 2019-05-13     600340       华夏幸福   0.9094\n",
       "85 2019-05-13     601155       新城控股   0.7801\n",
       "67 2019-05-13     600436        片仔癀   0.7394\n",
       "11 2019-05-13     000895       双汇发展   0.6180\n",
       "14 2019-05-13     000963       华东医药   0.5959\n",
       "95 2019-05-13     603589        口子窖   0.5864\n",
       "20 2019-05-13     002127       南极电商   0.5558\n",
       "70 2019-05-13     600516       方大炭素   0.5170\n",
       "40 2019-05-13     300136       信维通信   0.5006\n",
       "52 2019-05-13     300760       迈瑞医疗   0.4989\n",
       "38 2019-05-13     300122       智飞生物   0.4980\n",
       "25 2019-05-13     002460       赣锋锂业   0.4718\n",
       "66 2019-05-13     600426       华鲁恒升   0.4317\n",
       "84 2019-05-13     601138       工业富联   0.4312\n",
       "77 2019-05-13     600763       通策医疗   0.4084\n",
       "82 2019-05-13     600809       山西汾酒   0.4032\n",
       "78 2019-05-13     600779        水井坊   0.3873\n",
       "26 2019-05-13     002507       涪陵榨菜   0.3650\n",
       "46 2019-05-13     300601       康泰生物   0.3498\n",
       "9  2019-05-13     000830       鲁西化工   0.3495\n",
       "64 2019-05-13     600398       海澜之家   0.3465\n",
       "27 2019-05-13     002508       老板电器   0.3314\n",
       "80 2019-05-13     600801       华新水泥   0.2899\n",
       "..        ...        ...        ...      ...\n",
       "68 2019-05-13     600452       涪陵电力   0.0693\n",
       "29 2019-05-13     002755        奥赛康   0.0646\n",
       "53 2019-05-13     300761       立华股份   0.0633\n",
       "45 2019-05-13     300577       开润股份   0.0597\n",
       "0  2019-05-13     000048      *ST康达   0.0579\n",
       "65 2019-05-13     600408       ST安泰   0.0532\n",
       "15 2019-05-13     002016       世荣兆业   0.0528\n",
       "81 2019-05-13     600802       福建水泥   0.0526\n",
       "76 2019-05-13     600618       氯碱化工   0.0512\n",
       "49 2019-05-13     300751       迈为股份   0.0507\n",
       "10 2019-05-13     000885       城发环境   0.0506\n",
       "30 2019-05-13     002803       吉宏股份   0.0486\n",
       "86 2019-05-13     603068       博通集成   0.0485\n",
       "94 2019-05-13     603583       捷昌驱动   0.0482\n",
       "56 2019-05-13     300771       智莱科技   0.0465\n",
       "99 2019-05-13     603868       飞科电器   0.0440\n",
       "12 2019-05-13     000912        泸天化   0.0408\n",
       "37 2019-05-13     300121       阳谷华泰   0.0386\n",
       "32 2019-05-13     002901       大博医疗   0.0367\n",
       "97 2019-05-13     603666        亿嘉和   0.0367\n",
       "59 2019-05-13     600250       南纺股份   0.0351\n",
       "88 2019-05-13     603185       上机数控   0.0342\n",
       "34 2019-05-13     002947        恒铭达   0.0320\n",
       "3  2019-05-13     000502       绿景控股   0.0318\n",
       "98 2019-05-13     603700       宁波水表   0.0259\n",
       "54 2019-05-13     300763       锦浪科技   0.0253\n",
       "50 2019-05-13     300752       隆利科技   0.0250\n",
       "51 2019-05-13     300757       罗博特科   0.0245\n",
       "35 2019-05-13     002952       亚世光电   0.0225\n",
       "33 2019-05-13     002942       新农股份   0.0223\n",
       "\n",
       "[100 rows x 4 columns]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stocks['weight'] = stocks['weight'].apply(pd.to_numeric)\n",
    "stocks.sort_values(by=['weight'],ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "s,msg = swindex.get_index_dailyindicator('801193','2015-04-16','2019-05-14','D')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   avg_float_mv chg_pct    close       date dividend_yield_ratio   float_mv  \\\n",
      "0        324.03   -0.34  4383.58 2018-09-03                 1.91  12,313.08   \n",
      "1                 -0.15  4431.47 2018-08-14                 1.45              \n",
      "2        180.32   -0.33  4583.84 2018-07-13                 1.72   6,852.07   \n",
      "3        180.91    3.17  4598.91 2018-07-12                 1.74   6,874.60   \n",
      "4        417.98    0.09  5614.78 2018-04-03                 1.45  15,047.16   \n",
      "5        427.05    2.52  6213.65 2018-01-16                 1.50  14,946.66   \n",
      "6        417.04   -1.62  6060.72 2018-01-15                 1.54  14,596.38   \n",
      "7        424.28   -0.24  6160.36 2018-01-12                 1.51  14,849.65   \n",
      "8        286.06   -1.14  7032.90 2017-08-29                 1.44   9,725.96   \n",
      "9        289.36    5.99  7113.99 2017-08-28                 1.43   9,838.10   \n",
      "10       273.01    2.70  6712.05 2017-08-25                 1.51   9,282.38   \n",
      "11       282.12    0.61  6088.64 2017-05-24                 2.36   8,181.58   \n",
      "12       280.41    0.02  6051.74 2017-05-23                 2.38   8,131.99   \n",
      "13       280.35   -1.30  6050.38 2017-05-22                 2.35   8,130.16   \n",
      "14       284.00   -0.27  6129.81 2017-05-19                 2.37   8,236.05   \n",
      "15       284.78   -1.20  6146.52 2017-05-18                 2.41   8,258.51   \n",
      "16       288.22   -0.10  6220.87 2017-05-17                 2.38   8,358.41   \n",
      "17       288.52    0.45  6227.26 2017-05-16                 2.36   8,367.00   \n",
      "18       287.21    0.38  6199.06 2017-05-15                 2.37   8,329.11   \n",
      "19       280.55    0.75  6175.39 2017-05-12                 2.43   8,135.84   \n",
      "20       278.45    0.30  6129.32 2017-05-11                 2.45   8,075.15   \n",
      "21       277.61   -0.75  6110.71 2017-05-10                 2.46   8,050.63   \n",
      "22       279.44   -0.28  6156.96 2017-05-09                 2.44   8,103.83   \n",
      "23       280.23   -0.40  6174.22 2017-05-08                 2.43   8,126.55   \n",
      "24       281.36   -1.62  6199.29 2017-05-05                 2.42   8,159.55   \n",
      "25       286.00   -0.77  6301.54 2017-05-04                 2.38   8,294.13   \n",
      "26       288.23   -0.66  6350.46 2017-05-03                 2.36   8,358.53   \n",
      "27       290.13   -1.02  6392.46 2017-05-02                 2.35   8,413.81   \n",
      "28       291.67    0.11  6458.14 2017-04-28                 2.43   8,458.48   \n",
      "29       291.37    0.09  6451.31 2017-04-27                 2.44   8,449.61   \n",
      "\n",
      "   index_code index_name    pb     pe turn_rate turnover_pct volume   vwap  \n",
      "0      801193         证券  1.17  19.02    0.2743         1.48   4.25   7.80  \n",
      "1      801193         证券  1.16  17.77                   1.29   4.00   7.95  \n",
      "2      801193         证券  1.20  18.13    0.9200         2.01   7.47   8.37  \n",
      "3      801193         证券  1.20  18.19    1.2200         2.18   9.86   8.40  \n",
      "4      801193         证券  1.46  21.11    0.6231         2.32   9.38  10.59  \n",
      "5      801193         证券  1.63  24.73    0.7895         2.70  10.38  11.71  \n",
      "6      801193         证券  1.59  24.12    0.8292         2.45  10.90  11.41  \n",
      "7      801193         证券  1.62  24.52    0.5890         2.21   7.74  11.70  \n",
      "8      801193         证券  1.91  25.56    3.8900         7.16  29.32  13.70  \n",
      "9      801193         证券  1.93  25.85    6.2800         9.73  47.35  13.80  \n",
      "10     801193         证券  1.83  24.39    2.4600         5.21  18.54  12.98  \n",
      "11     801193         证券  1.64  21.72    1.0200         2.44   7.40  11.64  \n",
      "12     801193         证券  1.63  21.59    1.3300         2.54   9.64  11.53  \n",
      "13     801193         证券  1.63  21.58    1.1500         2.30   8.29  11.81  \n",
      "14     801193         证券  1.65  21.87    0.6900         1.69   4.95  12.07  \n",
      "15     801193         证券  1.65  21.93    0.7700         1.55   5.55  12.11  \n",
      "16     801193         证券  1.67  22.19    1.1400         1.88   8.24  12.27  \n",
      "17     801193         证券  1.67  22.21    1.0200         1.77   7.37  12.29  \n",
      "18     801193         证券  1.67  22.11    1.0600         2.61   7.65  12.21  \n",
      "19     801193         证券  1.64  21.74    1.2500         2.65   8.93  12.24  \n",
      "20     801193         证券  1.63  21.57    1.2700         2.37   9.07  12.18  \n",
      "21     801193         证券  1.62  21.51    1.1000         2.19   7.82  12.22  \n",
      "22     801193         证券  1.64  21.67    0.7800         1.81   5.56  12.32  \n",
      "23     801193         证券  1.66  21.72    1.4400         2.72  10.22  12.38  \n",
      "24     801193         证券  1.67  21.81    1.8700         3.58  13.32  12.55  \n",
      "25     801193         证券  1.70  22.17    0.9100         1.63   6.47  12.85  \n",
      "26     801193         证券  1.71  22.34    0.8300         1.63   5.92  13.02  \n",
      "27     801193         证券  1.72  22.49    0.6900         1.46   4.92  13.17  \n",
      "28     801193         证券  1.74  23.20    0.7800         1.60   5.51  13.29  \n",
      "29     801193         证券  1.74  23.18    1.1600         1.78   8.23  13.27  \n"
     ]
    }
   ],
   "source": [
    "print(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'6' not in s.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: []\n",
       "Index: []"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_list = stock.get_index_component('000300.SH')\n",
    "stock_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>证券代码</th>\n",
       "      <th>证券简称</th>\n",
       "      <th>总股本</th>\n",
       "      <th>流通股本</th>\n",
       "      <th>行业</th>\n",
       "      <th>计算标志</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>平安银行</td>\n",
       "      <td>17,170,411,366</td>\n",
       "      <td>17,170,245,848</td>\n",
       "      <td>J66    货币金融服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>万  科Ａ</td>\n",
       "      <td>9,724,196,533</td>\n",
       "      <td>9,715,170,043</td>\n",
       "      <td>K70    房地产业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>63</td>\n",
       "      <td>中兴通讯</td>\n",
       "      <td>3,437,169,309</td>\n",
       "      <td>3,434,115,193</td>\n",
       "      <td>C39    计算机、通信和其他电子设备</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>69</td>\n",
       "      <td>华侨城Ａ</td>\n",
       "      <td>8,204,081,415</td>\n",
       "      <td>7,016,679,909</td>\n",
       "      <td>K70    房地产业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>100</td>\n",
       "      <td>TCL 集团</td>\n",
       "      <td>13,549,648,507</td>\n",
       "      <td>12,698,342,803</td>\n",
       "      <td>C39    计算机、通信和其他电子设备</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>157</td>\n",
       "      <td>中联重科</td>\n",
       "      <td>6,433,120,998</td>\n",
       "      <td>6,295,722,471</td>\n",
       "      <td>C35    专用设备制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>166</td>\n",
       "      <td>申万宏源</td>\n",
       "      <td>22,535,944,560</td>\n",
       "      <td>22,534,414,205</td>\n",
       "      <td>J67    资本市场服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>333</td>\n",
       "      <td>美的集团</td>\n",
       "      <td>6,605,842,687</td>\n",
       "      <td>6,462,855,519</td>\n",
       "      <td>C38    电气机械和器材制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>338</td>\n",
       "      <td>潍柴动力</td>\n",
       "      <td>5,990,833,895</td>\n",
       "      <td>4,245,036,500</td>\n",
       "      <td>C36    汽车制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>402</td>\n",
       "      <td>金 融 街</td>\n",
       "      <td>2,988,929,907</td>\n",
       "      <td>2,987,631,546</td>\n",
       "      <td>K70    房地产业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>408</td>\n",
       "      <td>藏格控股</td>\n",
       "      <td>1,993,779,522</td>\n",
       "      <td>446,633,401</td>\n",
       "      <td>C26    化学原料和化学制品制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>413</td>\n",
       "      <td>东旭光电</td>\n",
       "      <td>5,480,250,117</td>\n",
       "      <td>4,864,155,314</td>\n",
       "      <td>C39    计算机、通信和其他电子设备</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>415</td>\n",
       "      <td>渤海租赁</td>\n",
       "      <td>6,184,521,282</td>\n",
       "      <td>3,547,396,604</td>\n",
       "      <td>L71    租赁业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>423</td>\n",
       "      <td>东阿阿胶</td>\n",
       "      <td>654,021,537</td>\n",
       "      <td>653,867,313</td>\n",
       "      <td>C27    医药制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>425</td>\n",
       "      <td>徐工机械</td>\n",
       "      <td>7,833,668,430</td>\n",
       "      <td>6,994,182,715</td>\n",
       "      <td>C35    专用设备制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>503</td>\n",
       "      <td>国新健康</td>\n",
       "      <td>898,822,204</td>\n",
       "      <td>898,822,204</td>\n",
       "      <td>I64    互联网和相关服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>538</td>\n",
       "      <td>云南白药</td>\n",
       "      <td>1,041,399,718</td>\n",
       "      <td>1,041,392,430</td>\n",
       "      <td>C27    医药制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>553</td>\n",
       "      <td>安道麦A</td>\n",
       "      <td>2,279,504,241</td>\n",
       "      <td>468,616,702</td>\n",
       "      <td>C26    化学原料和化学制品制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>568</td>\n",
       "      <td>泸州老窖</td>\n",
       "      <td>1,464,752,476</td>\n",
       "      <td>1,460,105,295</td>\n",
       "      <td>C15    酒、饮料和精制茶制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>625</td>\n",
       "      <td>长安汽车</td>\n",
       "      <td>3,900,662,369</td>\n",
       "      <td>3,760,881,066</td>\n",
       "      <td>C36    汽车制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>627</td>\n",
       "      <td>天茂集团</td>\n",
       "      <td>4,940,629,165</td>\n",
       "      <td>4,303,129,165</td>\n",
       "      <td>J68    保险业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>630</td>\n",
       "      <td>铜陵有色</td>\n",
       "      <td>10,526,533,308</td>\n",
       "      <td>9,560,558,253</td>\n",
       "      <td>C32    有色金属冶炼和压延加工业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>651</td>\n",
       "      <td>格力电器</td>\n",
       "      <td>6,015,730,878</td>\n",
       "      <td>5,969,919,153</td>\n",
       "      <td>C38    电气机械和器材制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>661</td>\n",
       "      <td>长春高新</td>\n",
       "      <td>170,112,265</td>\n",
       "      <td>170,037,846</td>\n",
       "      <td>C27    医药制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>671</td>\n",
       "      <td>阳 光 城</td>\n",
       "      <td>4,050,073,315</td>\n",
       "      <td>3,971,888,118</td>\n",
       "      <td>K70    房地产业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>703</td>\n",
       "      <td>恒逸石化</td>\n",
       "      <td>2,841,725,474</td>\n",
       "      <td>2,273,228,106</td>\n",
       "      <td>C28    化学纤维制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>709</td>\n",
       "      <td>河钢股份</td>\n",
       "      <td>10,618,607,852</td>\n",
       "      <td>10,616,892,601</td>\n",
       "      <td>C31    黑色金属冶炼和压延加工业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>725</td>\n",
       "      <td>京东方Ａ</td>\n",
       "      <td>33,862,285,275</td>\n",
       "      <td>33,859,749,557</td>\n",
       "      <td>C39    计算机、通信和其他电子设备</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>728</td>\n",
       "      <td>国元证券</td>\n",
       "      <td>3,365,447,047</td>\n",
       "      <td>2,946,124,300</td>\n",
       "      <td>J67    资本市场服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>768</td>\n",
       "      <td>中航飞机</td>\n",
       "      <td>2,768,645,071</td>\n",
       "      <td>2,768,628,046</td>\n",
       "      <td>C37    铁路、船舶、航空航天和其他</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>270</th>\n",
       "      <td>601828</td>\n",
       "      <td>美凯龙</td>\n",
       "      <td>2,876,103,969</td>\n",
       "      <td>395,788,197</td>\n",
       "      <td>L72    商务服务业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>271</th>\n",
       "      <td>601838</td>\n",
       "      <td>成都银行</td>\n",
       "      <td>3,612,251,334</td>\n",
       "      <td>1,866,634,468</td>\n",
       "      <td>J66    货币金融服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>272</th>\n",
       "      <td>601857</td>\n",
       "      <td>中国石油</td>\n",
       "      <td>161,922,077,818</td>\n",
       "      <td>161,922,077,818</td>\n",
       "      <td>B07    石油和天然气开采业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>273</th>\n",
       "      <td>601877</td>\n",
       "      <td>正泰电器</td>\n",
       "      <td>2,151,239,916</td>\n",
       "      <td>1,737,183,900</td>\n",
       "      <td>C38    电气机械和器材制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>274</th>\n",
       "      <td>601878</td>\n",
       "      <td>浙商证券</td>\n",
       "      <td>3,333,333,400</td>\n",
       "      <td>1,208,508,241</td>\n",
       "      <td>J67    资本市场服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>275</th>\n",
       "      <td>601881</td>\n",
       "      <td>中国银河</td>\n",
       "      <td>6,446,274,124</td>\n",
       "      <td>1,228,530,884</td>\n",
       "      <td>J67    资本市场服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>276</th>\n",
       "      <td>601888</td>\n",
       "      <td>中国国旅</td>\n",
       "      <td>1,952,475,544</td>\n",
       "      <td>1,952,475,544</td>\n",
       "      <td>L72    商务服务业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>277</th>\n",
       "      <td>601898</td>\n",
       "      <td>中煤能源</td>\n",
       "      <td>9,152,000,400</td>\n",
       "      <td>9,152,000,400</td>\n",
       "      <td>B06    煤炭开采和洗选业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>278</th>\n",
       "      <td>601899</td>\n",
       "      <td>紫金矿业</td>\n",
       "      <td>17,294,278,891</td>\n",
       "      <td>16,875,725,837</td>\n",
       "      <td>B09    有色金属矿采选业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>279</th>\n",
       "      <td>601901</td>\n",
       "      <td>方正证券</td>\n",
       "      <td>8,232,101,395</td>\n",
       "      <td>8,232,101,395</td>\n",
       "      <td>J67    资本市场服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>280</th>\n",
       "      <td>601919</td>\n",
       "      <td>中远海控</td>\n",
       "      <td>9,678,929,227</td>\n",
       "      <td>7,635,674,357</td>\n",
       "      <td>G55    水上运输业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>281</th>\n",
       "      <td>601933</td>\n",
       "      <td>永辉超市</td>\n",
       "      <td>9,570,462,108</td>\n",
       "      <td>7,968,291,316</td>\n",
       "      <td>F52    零售业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>282</th>\n",
       "      <td>601939</td>\n",
       "      <td>建设银行</td>\n",
       "      <td>9,593,657,606</td>\n",
       "      <td>9,593,657,606</td>\n",
       "      <td>J66    货币金融服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>283</th>\n",
       "      <td>601985</td>\n",
       "      <td>中国核电</td>\n",
       "      <td>15,565,430,000</td>\n",
       "      <td>15,565,430,000</td>\n",
       "      <td>D44    电力、热力生产和供应业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>284</th>\n",
       "      <td>601988</td>\n",
       "      <td>中国银行</td>\n",
       "      <td>210,765,514,846</td>\n",
       "      <td>210,765,514,846</td>\n",
       "      <td>J66    货币金融服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>285</th>\n",
       "      <td>601989</td>\n",
       "      <td>中国重工</td>\n",
       "      <td>22,879,793,243</td>\n",
       "      <td>18,361,665,066</td>\n",
       "      <td>C37    铁路、船舶、航空航天和其他</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>286</th>\n",
       "      <td>601991</td>\n",
       "      <td>大唐发电</td>\n",
       "      <td>12,396,089,106</td>\n",
       "      <td>9,994,360,000</td>\n",
       "      <td>D44    电力、热力生产和供应业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>287</th>\n",
       "      <td>601992</td>\n",
       "      <td>金隅集团</td>\n",
       "      <td>8,339,006,264</td>\n",
       "      <td>8,334,158,264</td>\n",
       "      <td>C30    非金属矿物制品业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>288</th>\n",
       "      <td>601997</td>\n",
       "      <td>贵阳银行</td>\n",
       "      <td>2,298,591,900</td>\n",
       "      <td>1,238,965,095</td>\n",
       "      <td>J66    货币金融服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>289</th>\n",
       "      <td>601998</td>\n",
       "      <td>中信银行</td>\n",
       "      <td>34,052,633,596</td>\n",
       "      <td>31,905,164,057</td>\n",
       "      <td>J66    货币金融服务</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>290</th>\n",
       "      <td>603156</td>\n",
       "      <td>养元饮品</td>\n",
       "      <td>1,054,578,000</td>\n",
       "      <td>639,445,325</td>\n",
       "      <td>C15    酒、饮料和精制茶制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>291</th>\n",
       "      <td>603160</td>\n",
       "      <td>汇顶科技</td>\n",
       "      <td>456,651,659</td>\n",
       "      <td>231,595,583</td>\n",
       "      <td>C39    计算机、通信和其他电子设备</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>292</th>\n",
       "      <td>603259</td>\n",
       "      <td>药明康德</td>\n",
       "      <td>1,048,266,886</td>\n",
       "      <td>718,626,073</td>\n",
       "      <td>M73    研究和试验发展</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>293</th>\n",
       "      <td>603260</td>\n",
       "      <td>合盛硅业</td>\n",
       "      <td>670,000,000</td>\n",
       "      <td>260,841,805</td>\n",
       "      <td>C26    化学原料和化学制品制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>294</th>\n",
       "      <td>603288</td>\n",
       "      <td>海天味业</td>\n",
       "      <td>2,700,369,340</td>\n",
       "      <td>2,700,369,340</td>\n",
       "      <td>C14    食品制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>295</th>\n",
       "      <td>603799</td>\n",
       "      <td>华友钴业</td>\n",
       "      <td>829,747,285</td>\n",
       "      <td>819,881,192</td>\n",
       "      <td>C32    有色金属冶炼和压延加工业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>296</th>\n",
       "      <td>603833</td>\n",
       "      <td>欧派家居</td>\n",
       "      <td>420,191,551</td>\n",
       "      <td>92,108,143</td>\n",
       "      <td>C21    家具制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>297</th>\n",
       "      <td>603858</td>\n",
       "      <td>步长制药</td>\n",
       "      <td>886,340,000</td>\n",
       "      <td>426,185,646</td>\n",
       "      <td>C27    医药制造业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>298</th>\n",
       "      <td>603986</td>\n",
       "      <td>兆易创新</td>\n",
       "      <td>284,894,488</td>\n",
       "      <td>207,397,179</td>\n",
       "      <td>C39    计算机、通信和其他电子设备</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>299</th>\n",
       "      <td>603993</td>\n",
       "      <td>洛阳钼业</td>\n",
       "      <td>17,665,772,583</td>\n",
       "      <td>17,665,772,583</td>\n",
       "      <td>B09    有色金属矿采选业</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>300 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       证券代码    证券简称              总股本             流通股本                    行业  \\\n",
       "0         1    平安银行   17,170,411,366   17,170,245,848         J66    货币金融服务   \n",
       "1         2   万  科Ａ    9,724,196,533    9,715,170,043           K70    房地产业   \n",
       "2        63    中兴通讯    3,437,169,309    3,434,115,193  C39    计算机、通信和其他电子设备   \n",
       "3        69    华侨城Ａ    8,204,081,415    7,016,679,909           K70    房地产业   \n",
       "4       100  TCL 集团   13,549,648,507   12,698,342,803  C39    计算机、通信和其他电子设备   \n",
       "5       157    中联重科    6,433,120,998    6,295,722,471        C35    专用设备制造业   \n",
       "6       166    申万宏源   22,535,944,560   22,534,414,205         J67    资本市场服务   \n",
       "7       333    美的集团    6,605,842,687    6,462,855,519     C38    电气机械和器材制造业   \n",
       "8       338    潍柴动力    5,990,833,895    4,245,036,500          C36    汽车制造业   \n",
       "9       402   金 融 街    2,988,929,907    2,987,631,546           K70    房地产业   \n",
       "10      408    藏格控股    1,993,779,522      446,633,401   C26    化学原料和化学制品制造业   \n",
       "11      413    东旭光电    5,480,250,117    4,864,155,314  C39    计算机、通信和其他电子设备   \n",
       "12      415    渤海租赁    6,184,521,282    3,547,396,604            L71    租赁业   \n",
       "13      423    东阿阿胶      654,021,537      653,867,313          C27    医药制造业   \n",
       "14      425    徐工机械    7,833,668,430    6,994,182,715        C35    专用设备制造业   \n",
       "15      503    国新健康      898,822,204      898,822,204       I64    互联网和相关服务   \n",
       "16      538    云南白药    1,041,399,718    1,041,392,430          C27    医药制造业   \n",
       "17      553    安道麦A    2,279,504,241      468,616,702   C26    化学原料和化学制品制造业   \n",
       "18      568    泸州老窖    1,464,752,476    1,460,105,295    C15    酒、饮料和精制茶制造业   \n",
       "19      625    长安汽车    3,900,662,369    3,760,881,066          C36    汽车制造业   \n",
       "20      627    天茂集团    4,940,629,165    4,303,129,165            J68    保险业   \n",
       "21      630    铜陵有色   10,526,533,308    9,560,558,253   C32    有色金属冶炼和压延加工业   \n",
       "22      651    格力电器    6,015,730,878    5,969,919,153     C38    电气机械和器材制造业   \n",
       "23      661    长春高新      170,112,265      170,037,846          C27    医药制造业   \n",
       "24      671   阳 光 城    4,050,073,315    3,971,888,118           K70    房地产业   \n",
       "25      703    恒逸石化    2,841,725,474    2,273,228,106        C28    化学纤维制造业   \n",
       "26      709    河钢股份   10,618,607,852   10,616,892,601   C31    黑色金属冶炼和压延加工业   \n",
       "27      725    京东方Ａ   33,862,285,275   33,859,749,557  C39    计算机、通信和其他电子设备   \n",
       "28      728    国元证券    3,365,447,047    2,946,124,300         J67    资本市场服务   \n",
       "29      768    中航飞机    2,768,645,071    2,768,628,046  C37    铁路、船舶、航空航天和其他   \n",
       "..      ...     ...              ...              ...                   ...   \n",
       "270  601828     美凯龙    2,876,103,969      395,788,197          L72    商务服务业   \n",
       "271  601838    成都银行    3,612,251,334    1,866,634,468         J66    货币金融服务   \n",
       "272  601857    中国石油  161,922,077,818  161,922,077,818      B07    石油和天然气开采业   \n",
       "273  601877    正泰电器    2,151,239,916    1,737,183,900     C38    电气机械和器材制造业   \n",
       "274  601878    浙商证券    3,333,333,400    1,208,508,241         J67    资本市场服务   \n",
       "275  601881    中国银河    6,446,274,124    1,228,530,884         J67    资本市场服务   \n",
       "276  601888    中国国旅    1,952,475,544    1,952,475,544          L72    商务服务业   \n",
       "277  601898    中煤能源    9,152,000,400    9,152,000,400       B06    煤炭开采和洗选业   \n",
       "278  601899    紫金矿业   17,294,278,891   16,875,725,837       B09    有色金属矿采选业   \n",
       "279  601901    方正证券    8,232,101,395    8,232,101,395         J67    资本市场服务   \n",
       "280  601919    中远海控    9,678,929,227    7,635,674,357          G55    水上运输业   \n",
       "281  601933    永辉超市    9,570,462,108    7,968,291,316            F52    零售业   \n",
       "282  601939    建设银行    9,593,657,606    9,593,657,606         J66    货币金融服务   \n",
       "283  601985    中国核电   15,565,430,000   15,565,430,000    D44    电力、热力生产和供应业   \n",
       "284  601988    中国银行  210,765,514,846  210,765,514,846         J66    货币金融服务   \n",
       "285  601989    中国重工   22,879,793,243   18,361,665,066  C37    铁路、船舶、航空航天和其他   \n",
       "286  601991    大唐发电   12,396,089,106    9,994,360,000    D44    电力、热力生产和供应业   \n",
       "287  601992    金隅集团    8,339,006,264    8,334,158,264       C30    非金属矿物制品业   \n",
       "288  601997    贵阳银行    2,298,591,900    1,238,965,095         J66    货币金融服务   \n",
       "289  601998    中信银行   34,052,633,596   31,905,164,057         J66    货币金融服务   \n",
       "290  603156    养元饮品    1,054,578,000      639,445,325    C15    酒、饮料和精制茶制造业   \n",
       "291  603160    汇顶科技      456,651,659      231,595,583  C39    计算机、通信和其他电子设备   \n",
       "292  603259    药明康德    1,048,266,886      718,626,073        M73    研究和试验发展   \n",
       "293  603260    合盛硅业      670,000,000      260,841,805   C26    化学原料和化学制品制造业   \n",
       "294  603288    海天味业    2,700,369,340    2,700,369,340          C14    食品制造业   \n",
       "295  603799    华友钴业      829,747,285      819,881,192   C32    有色金属冶炼和压延加工业   \n",
       "296  603833    欧派家居      420,191,551       92,108,143          C21    家具制造业   \n",
       "297  603858    步长制药      886,340,000      426,185,646          C27    医药制造业   \n",
       "298  603986    兆易创新      284,894,488      207,397,179  C39    计算机、通信和其他电子设备   \n",
       "299  603993    洛阳钼业   17,665,772,583   17,665,772,583       B09    有色金属矿采选业   \n",
       "\n",
       "     计算标志  \n",
       "0       1  \n",
       "1       1  \n",
       "2       1  \n",
       "3       1  \n",
       "4       1  \n",
       "5       1  \n",
       "6       1  \n",
       "7       1  \n",
       "8       1  \n",
       "9       1  \n",
       "10      1  \n",
       "11      1  \n",
       "12      1  \n",
       "13      1  \n",
       "14      1  \n",
       "15      1  \n",
       "16      1  \n",
       "17      1  \n",
       "18      1  \n",
       "19      1  \n",
       "20      1  \n",
       "21      1  \n",
       "22      1  \n",
       "23      1  \n",
       "24      1  \n",
       "25      1  \n",
       "26      1  \n",
       "27      1  \n",
       "28      1  \n",
       "29      1  \n",
       "..    ...  \n",
       "270     1  \n",
       "271     1  \n",
       "272     1  \n",
       "273     1  \n",
       "274     1  \n",
       "275     1  \n",
       "276     1  \n",
       "277     1  \n",
       "278     1  \n",
       "279     1  \n",
       "280     1  \n",
       "281     1  \n",
       "282     1  \n",
       "283     1  \n",
       "284     1  \n",
       "285     1  \n",
       "286     1  \n",
       "287     1  \n",
       "288     1  \n",
       "289     1  \n",
       "290     1  \n",
       "291     1  \n",
       "292     1  \n",
       "293     1  \n",
       "294     1  \n",
       "295     1  \n",
       "296     1  \n",
       "297     1  \n",
       "298     1  \n",
       "299     1  \n",
       "\n",
       "[300 rows x 6 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_list"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
